/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.com.jvpn.tools.resourcesTools;

import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Ken
 */
public class PropertiesTools {

    private static String sysconfig = "cn.com.jvpn.resources.sysconfig";

    public static String readProperties(String resource, String key) {
        if (key == null || key.equals("") || key.equals("null")) {
            return "";
        }
        String value = "";
        try {
            ResourceBundle rb = ResourceBundle.getBundle(resource);
            value = rb.getString(key).trim();
        } catch (Exception ex) {
            Logger.getLogger(PropertiesTools.class.getName()).log(Level.SEVERE, null, ex);
        }

        return value;
    }

    public static String readSysConfig(String key) {
        String value = "";
        value = PropertiesTools.readProperties(sysconfig, key);
        return value;
    }
}
